<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib prefix="s" uri="/struts-tags" %>
<script type="text/javascript">
function checkAdd()
{
	v=document.getElementById("value").value;
	if ((v == "")) {
    	alert("Enter the value.");
    	 return false;        
    }
	
}
function confirmSubmit()
{
var agree=confirm("Are you sure you wish to Delete?");
if (agree)
	return true ;
else
	return false ;
}
</script>
<div>Attribute Set ${attributeSet.name} (Id=${attributeSet.uuid})</div>

<div>Edit Attribute ${attribute.name} (Id=${attribute.uuid})</div>


<form name="changeValue" action="changeValue" method="post" onsubmit="return confirmSubmit()">
	<table>
		<tr><td>Attribute Type</td><td>${attributeValue.attributeType}</td><td>(Id=${attributeValue.uuid})</td></tr>
		<tr><td>Attribute Label</td>
				<td><input type="hidden" name="valueUuid" value="${attributeValue.uuid}">
					<input type="hidden" name="uuid" value="${attributeSet.uuid}">
					<input type="hidden" name="attributeUuid" value="${attribute.uuid}">
					<input type="hidden" name="p" value="${p}">
					<input type="text" name="valuelabel" value="${attributeValue.label}" readonly="readonly"></td></tr>
	</table>
	
				<div>Manage Values</div>
	<table>
		<tr><td>Delete</td><td>${attributeValue.attributeType} Value</td></tr>
		<s:iterator value="values" var="v">
			<tr><td><input type="checkbox" name="${v}" value="${v}"></td><td>${v}</td></tr>
		</s:iterator>
			<tr><td></td><td><input type="submit" name="Update" value="Update"></td></tr>
	</table>


</form>


<form method="post" action="addNewValue" name="addNewValue" onsubmit="return checkAdd()">
<table>
	<tr><td></td><td>Add new value to dropdown</td></tr>
	<tr><td>Value</td>
		<td>
			<input type="text" name="newdropValue" value="" id="value">
			<input type="hidden" name="valueUuid" value="${attributeValue.uuid}">
			<input type="hidden" name="uuid" value="${attributeSet.uuid}">
			<input type="hidden" name="attributeUuid" value="${attribute.uuid}">
			<input type="hidden" name="p" value="${p}">
			<input type="submit" name="Add" value="Add">
		</td>
		<td></td></tr>
</table>
</form>

<a href="${backUrl}">Back</a>
